package com.itheima.test2;

public class Phone {
    //成员变量
    String name;
    int price;
    //set和get方法
    public void setName(String name){
        this.name = name;
    }
    public void setPrice(int price){
        this.price = price;
    }
    public String getName(){
        return name;
    }
    public int getPrice(){
        return price;
    }
    //空参，全参构造
    public Phone(){};
    public Phone(String name, int price){
        this.name = name;
        this.price = price;
    }
    public void playGame(){
        System.out.println("手机在玩游戏");
    }

}
